package nbcp.base.extend


import nbcp.db.CodeName
import nbcp.web.HttpContext
import nbcp.db.IdName

import nbcp.base.utils.MyUtil
import nbcp.db.LoginUserModel
import nbcp.db.mongo.entity.SysUser
import nbcp.web.ClientIp
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpSession

/**
 * Created by udi on 17-5-23.
 */

var HttpSession.LoginUserIsAdmin: Boolean
    get() {
        return this.getAttribute("LoginUserIsAdmin").AsBoolean()
    }
    set(value) {
        this.setAttribute("LoginUserIsAdmin", value);
    }

//图片验证码,以后保存到 redis.
var HttpSession.ValidateCode: String
    get() {
        return this.getAttribute("ValidateCode")?.toString() ?: "";
    }
    set(value) {
        this.setAttribute("ValidateCode", value);
    }

//手机验证码,以后保存到 redis.
var HttpSession.MobileCode: String
    get() {
        return this.getAttribute("MobileCode")?.toString() ?: "";
    }
    set(value) {
        this.setAttribute("MobileCode", value);
    }
